import React from 'react'
import { useNavigate } from 'react-router-dom'

function Order(props) {
    const { data } = props
    const navigate = useNavigate()
    return (
        <div>
            <div >

                {
                    data.map((item) => {
                        return (
                            <div onClick={() => {
                                navigate(`/orderDetail?id=` + item.id)
                            }} style={{ display: 'flex', justifyContent: 'space-between' }}>
                                <div>
                                    <p>21:11</p>
                                    <p>{item.start}</p>
                                </div>
                                <div>
                                    <p>D2121</p>
                                    <p>{item.startTime}时</p>
                                </div>
                                <div>
                                    <p>21:11</p>
                                    <p>{item.end}</p>
                                </div>
                                <div>
                                    <p>￥{item.tick.secondTick}起</p>
                                    <p>{item.isSeat ? '高铁' : '动车'}</p>

                                </div>
                            </div>
                        )
                    })
                }

            </div>
        </div>
    )
}

export default Order